$(function() {
	$("#stu-assi-search").hide();
	$("#small-class-group").hide();
	$("#search-list").hide();
	$("#had-add-list").hide();
	$("#new-personal-task-publish").click(function() {
		$("#stu-assi-search").hide();
		$("#small-class-group").hide();
		$("#search-list").hide();
		$("#had-add-list").hide();
		layer.open({
			type: 1,
			title: '发布任务',
			fixed: false, //不固定
			maxmin: true,
			closeBtn: 1,
			scrollbar: false,
			skin: 'layui-layer-molv',
			area: ['70rem', '45rem'],
			content: $("#add-personal-publish-object"),
			end: function () {
                window.location.reload();
            }
		});
	});
	
	$("#select-all").click(function() {
		if($("#select-all").attr("value")=="取消全选") {
			$("#select-all").attr("value","全选");
			$("#select-all").attr("class","btn btn-info");
			$("#task-pub-record-personal .check").prop("checked",false);
		} else if($("#select-all").attr("value")=="全选") {
			$("#select-all").attr("value","取消全选");
			$("#select-all").attr("class","btn btn-success");
			$("#task-pub-record-personal .check").prop("checked",true);
		}
	});
	
	
});


function selectTaskType(value) {
	$("#searchList").empty();
	var selectedOption = value.options[value.selectedIndex];
	if(selectedOption.value == "STUDENT" || selectedOption.value == "ASSISTANT") {
		$("#stu-assi-search").show();
		$("#search-list").show();
		$("#had-add-list").show();
	} else if(selectedOption.value == "CLASS") {
		$("#stu-assi-search").hide();
		$("#search-list").show();
		$("#had-add-list").show();
		getClass();
	} else if(selectedOption.value == "err") {
		$("#stu-assi-search").hide();
		$("#search-list").hide();
		$("#had-add-list").hide();
	}
}
